<p>
{if isset($leagueId) }
	{foreach from=$teams key=myId item=i name=teamT}
		{if $smarty.foreach.teamT.first}
			<table>
				<caption>{$league->league} Ligi Takim Listesi</caption>
				<tr>
					<th>Takim</th><th>Islem</th>
				</tr>
		{/if}
		<tr>
			<td>{$i->team}</td>
			<td>
				{if isset($i->leagueId)}
					<a href="?action=Delete&Id={$i->id}&leagueId={$i->leagueId}">Sil</a>
				{else}
					<a href="?action=Add&Id={$i->id}&leagueId={$leagueId}">Ekle</a>
				{/if}
			</td>		
		</tr>
		{if $smarty.foreach.teamT.last}
			</table>
		{/if}
	{/foreach}
{else}
	{foreach from=$teams key=myId item=i name=teamT}
		{if $smarty.foreach.teamT.first}
			<table>
				<caption>Takim Listesi</caption>
				<tr>
					<th>Takim</th><th>Aciklama</th>
				</tr>
		{/if}
		<tr>
			<td>{$i->team}</td><td>{$i->memo}</td>
			<td><a href="?action=Delete&Id={$i->id}">Sil</a> |
				<a href="?action=Form&Id={$i->id}">Degistir</a>
			</td>		
		</tr>
		{if $smarty.foreach.teamT.last}
			</table>
		{/if}
	{/foreach}
{/if}
</p>